//
//  KSSupplyOrderTableViewCell.swift
//  Supermarket
//
//  Created by liuxm on 2017/9/25.
//  Copyright © 2017年 kushao. All rights reserved.
//

import UIKit

class KSSupplyOrderTableViewCell: UITableViewCell {
    
    /// 订单编号
    @IBOutlet weak var orderNoLabel: UILabel!
    /// 订单状态
    @IBOutlet weak var orderStatusLabel: UILabel!
    /// 发货仓
    @IBOutlet weak var warehouseLabel: UILabel!
    /// 下单数量
    @IBOutlet weak var orderNumLabel: UILabel!
    /// 整单金额
    @IBOutlet weak var moneyLabel: UILabel!
    /// 下单时间
    @IBOutlet weak var orderTimeLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    func setDataWithOrderList(model: KSGetOrderListDataListModel) {
        orderNoLabel.text = model.order_number
        warehouseLabel.text = model.storage_name
        orderStatusLabel.text = KSTools.getOrderDescriptionByStatus(status: model.order_state)
        moneyLabel.text = "\(model.order_amount)"
        if model.add_time.characters.count > 11 {
            orderTimeLabel.text = model.add_time.substring(from: 0, length: 11)
        }
    }
    
    func setDataWithJhModel(model: KSStorageJhlistPickListModel) {
        orderNoLabel.text = model.pickid
        warehouseLabel.text = model.storage_name
        orderStatusLabel.text = KSTools.getOrderDescriptionByStatus(status: model.order_state!)
        orderNumLabel.text = "\(model.num)"
        moneyLabel.text = "\(model.order_amount)"
        if model.add_time.characters.count > 11 {
            orderTimeLabel.text = model.add_time.substring(from: 0, length: 11)
        }
    }
    
    func setDataWithFjModel(model: KSStorageFjlistPickListModel) {
        orderNoLabel.text = model.pickid!
        warehouseLabel.text = model.storage_name
        orderNumLabel.text = "\(model.num!)"
        moneyLabel.text = "\(model.order_amount!)"
        if model.add_time!.characters.count > 11 {
            orderTimeLabel.text = model.add_time!.substring(from: 0, length: 11)
        }
    }
    
    func setDataWithZcModel(model: KSStorageZclistModelDetail) {
        orderNoLabel.text = model.dispatching_id
        warehouseLabel.text = model.name
        orderNumLabel.text = "\(model.num!)"
        moneyLabel.text = "\(model.order_amount!)"
        if model.add_time!.characters.count > 11 {
            orderTimeLabel.text = model.add_time!.substring(from: 0, length: 11)
        }
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
